package product;

import javax.swing.JPanel;

import java.awt.BorderLayout;

import javax.swing.JLabel;

import java.awt.FlowLayout;

import javax.swing.JRadioButtonMenuItem;
import javax.swing.JComboBox;

import java.awt.Label;

import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTabbedPane;
import javax.swing.border.TitledBorder;

import java.awt.Component;
import java.awt.Color;

import javax.swing.UIManager;
import javax.swing.border.LineBorder;
import javax.swing.ImageIcon;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.border.BevelBorder;
import javax.swing.plaf.metal.MetalBorders.TableHeaderBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import java.util.Vector;

import javax.swing.JScrollPane;

import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;

import java.awt.Font;
import java.awt.SystemColor;

public class Employee extends JPanel {
	MethodClass mc = new MethodClass();	
	String filename = "noname";
	DefaultTableModel model = new DefaultTableModel(); // 모델
	
	boolean hdFlag=true;//유급 휴가창 오픈 유무
	
	HashMap<String, TempData> map = null;
	Vector<String> colName = new Vector<String>(); // 테이블 컬럼명 지정
	Vector<String> test = new Vector<String>(); // 집합된 데이터들을 저장할 벡터

	String person_num; // 사번. 로그인할때 얻어올 사번					//// &&&&&&&&&&&&&&&&&&&&&&&&&&7
	String person_name;
	String startDate;
	String [] su = {"14","13","12","11","10","09","08","07","06","05","04","전체"};//년
	String [] su1 = {"01","02","03","04","05","06","07","08","09","10","11","12","전체"};//월	
	String [] su2 = {"01","02","03","04","전체"}; //분기 // -추가-
	Connection conn;
	DecimalFormat df = new DecimalFormat("#,###,###,###,###");	
	Hollyday hd = new Hollyday(Employee.this);		

	PolylineBarChart p;  //근환이형//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	private JPanel panel;
	private JPanel panel_1;
	private JTabbedPane tabbedPane;
	private JPanel panel_4;
	public JLabel irum;
	public JLabel number;
	public JLabel date;
	private JComboBox comboBox;
	private JButton search;
	private JLabel paymentD;
	public JLabel nal;
	private JButton btnNewButton;
	private JButton btnNewButton_1;
	private JPanel panel_5;
	private JScrollPane scrollPane;
	public JTable table;

	private JComboBox comboBox1;
	private JButton btnNewButton_2;
	private JPanel panel_2;
	private JPanel panel_3;
	private JPanel panel_6;
	JComboBox comboBox_11;
	JComboBox comboBox_12;
	private JButton btnNewButton_3 ;
	JLabel gunsu;

	/**
	 * Create the panel.
	 */
	public Employee(Connection conn) {
		this.conn=conn;		
		colName.add("사원번호");
		colName.add("부서별");
		colName.add("직책");
		colName.add("성명");
		colName.add("일당");
		colName.add("출근일수");
		colName.add("유급휴가");
		colName.add("급여");
		colName.add("년도/월");

		setLayout(new BorderLayout(0, 0));
		add(getPanel(), BorderLayout.NORTH);
		add(getPanel_1(), BorderLayout.SOUTH);
		add(getTabbedPane(), BorderLayout.CENTER);
		JTableHeader th = table.getTableHeader();
		th.setReorderingAllowed(false);
		
		
		
		}

	public void mouseC(JTable table){							//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&7
		hd.setAlwaysOnTop(true); //프레임 무조건 위에 있게하기? hd는 HollyDay임?
		if(hd.getState() == 1){	//최소화 상태
			hd.setState(0);		//위로 올라오게
		}
		int Y = comboBox1.getSelectedIndex();   //년     
		int M = comboBox.getSelectedIndex();	//월   13개 0~12
		String yy=su[Y];			//해당년도
		String mm=su1[M];		//해당 월
		String id=person_num;	
		
    	int idxrow = table.getSelectedRow();// 선택된 열의 table index번호를 저장
		int index = table.getSelectedColumn();// 선택된 컬럼의 table index번호를 저장
		
		if(mm=="전체")	{			 // 테이블에 선택된 로우를 월로 바꿈... 데이터가 총12개(1-12월)일땐 가능함!	
			mm= Integer.toString(idxrow+1); 	
			if(idxrow<=8) {
				mm="0"+ Integer.toString(idxrow+1);
			}
		}
		if(table.getRowCount()>=2 && idxrow+1==table.getRowCount()) mm="%";	//전체조회에서 총 급여 구할때
		
		if(index == 6){ 		// 							유급휴가를 눌렀으면				
			String sql="select "+
					" (select nvl(count(holytype),0) from holydata where memberid='"+id+"' and holytype=1 and holydate like '%"+yy+"/"+mm+"/%'),"+
					" (select nvl(count(holytype),0) from holydata where memberid='"+id+"' and holytype=2 and holydate like '%"+yy+"/"+mm+"/%'),"+
					" (select nvl(count(holytype),0) from holydata where memberid='"+id+"' and holytype=3 and holydate like '%"+yy+"/"+mm+"/%'),"+
					" (select nvl(count(holytype),0) from holydata where memberid='"+id+"' and holytype=4 and holydate like '%"+yy+"/"+mm+"/%')"+
					" from holydata group by memberid having memberid='"+id+"'";			
			try{
				PreparedStatement pstmt=conn.prepareStatement(sql);
				ResultSet rs=pstmt.executeQuery();				
				if(rs.next()){
					Vector v=new Vector<>();
					v.add(person_name);
					for(int i=1; i<=4; i++){					
						v.add(rs.getString(i)+"일");		//백터에4개추가								
					}
					int tot=Integer.parseInt(rs.getString(1))+Integer.parseInt(rs.getString(2))+
							Integer.parseInt(rs.getString(3))+Integer.parseInt(rs.getString(4)) ;
					v.add(tot+"일");						//총합추가
					
					if(mm=="%") mm="전체";			//휴가날짜
					v.add(yy+"/"+mm);
								
					if(hd.model.getDataVector().contains(v)){			//같은거 누르면 추가 안되게
						return;
					}
					hd.model.addRow(v);
				}
				else{
					Vector v=new Vector();		//휴가가 0일때
					v.add(id);
					for(int i=1;i<=5;i++){
						v.add("0");
					}
					if(mm=="%") mm="전체";	
					v.add(yy+"/"+mm);
					
					hd.model.addRow(v);					
				}				
				if(hdFlag) hd.setVisible(true);				
				if(hd.isVisible()==false) hd.setVisible(true);				
				test.removeAllElements();
				rs.close(); pstmt.close();
				hdFlag=false;
			}catch(Exception ex){
				ex.printStackTrace();
			}
		}
	}
	public void Search(){ 										//&&&&&&&&&&
		
		model.setNumRows(0);
		int Y = comboBox1.getSelectedIndex(); //년   
		int M = comboBox.getSelectedIndex();	//월   13개 0~12
		String yy=su[Y];	    //0->"14"   1->"13" ........11->"전체"
		String mm=su1[M];	//0->"01"   1->"02"					
	
		if(mm=="전체"){
				toto();	return;
			}
		String id=person_num;	
		String sql="select memberid,team,position,irum,pay, "+
				" (select count(chultype) from chuldata where chultype=1 and memberid='"+id+"' and chuldate like '%"+yy+"/"+mm+"/%') ,"+
				" (select count(holytype) from holydata where holytype!=0 and memberid='"+id+"' and holydate like '%"+yy+"/"+mm+"/%'),"+
				" ((select count(chultype) from chuldata where chultype=1 and memberid='"+id+"'  and chuldate like '%"+yy+"/"+mm+"/%')+"+
				" (select count(holytype) from holydata where holytype!=0 and memberid='"+id+"' and holydate like '%"+yy+"/"+mm+"/%') )*pay"+
				" from memberdata "+
				" where memberid='"+id+"'" ;			
		try{			
			PreparedStatement pstmt=conn.prepareStatement(sql);			
			ResultSet rs=pstmt.executeQuery();			
			
				if(rs.next()){
				Vector vec= new Vector<>();
				vec.add(rs.getString(1));	
				vec.add(rs.getString(2));	
				vec.add(rs.getString(3));	
				vec.add(rs.getString(4));	
				vec.add(df.format(Integer.parseInt(rs.getString(5))) );	
				vec.add(rs.getString(6));	
				vec.add(rs.getString(7));	
				vec.add(df.format(Integer.parseInt(rs.getString(8))) );	
				vec.add(yy+"/"+mm);
				
				if(rs.getString(6).equals("0")  && rs.getString(7).equals("0")){ gunsu.setText("건수 :0");  return	;	}	
				model.addRow(vec);	
				gunsu.setText("건수 :"+this.model.getRowCount());
				
			}
			
			rs.close(); pstmt.close();
		}catch(Exception ex){
			ex.printStackTrace();
		}		
		
	}
	
	public void toto(){
		int Y = comboBox1.getSelectedIndex(); 
		int M = comboBox.getSelectedIndex();
		String id=person_num;	
		String yy=su[Y];		
		String mm=su1[M];			
		for(int k =0; k<=12; k++){		//1월부터 12까지  총 12번 쿼리 실행					
			mm=su1[k];
			if(mm=="전체") mm="%";
			String sql="select memberid,team,position,irum,pay, "+
					" (select count(chultype) from chuldata where chultype=1 and memberid='"+id+"' and chuldate like '%"+yy+"/"+mm+"/%') ,"+
					" (select count(holytype) from holydata where holytype!=0 and memberid='"+id+"' and holydate like '%"+yy+"/"+mm+"/%'),"+
					" ((select count(chultype) from chuldata where chultype=1 and memberid='"+id+"'  and chuldate like '%"+yy+"/"+mm+"/%')+"+
					" (select count(holytype) from holydata where holytype!=0 and memberid='"+id+"' and holydate like '%"+yy+"/"+mm+"/%') )*pay"+
					" from memberdata "+
					" where memberid='"+id+"'" ;			
			try{			
				PreparedStatement pstmt=conn.prepareStatement(sql);			
				ResultSet rs=pstmt.executeQuery();	
				
				while(rs.next()){
					if(!(rs.getString(6).equals("0")  && rs.getString(7).equals("0") && yy=="14" && (mm=="06"
							 || mm=="07" || mm=="08" || mm=="09" || mm=="10" || mm=="11" || mm=="12"))){
					Vector vec= new Vector<>();						
					vec.add(rs.getString(1));	
					vec.add(rs.getString(2));	
					vec.add(rs.getString(3));	
					vec.add(rs.getString(4));	
					vec.add(df.format(Integer.parseInt(rs.getString(5))) );	
					vec.add(rs.getString(6));	
					vec.add(rs.getString(7));	
					vec.add(df.format(Integer.parseInt(rs.getString(8))) );		
					if(mm=="%") mm="전체";
					vec.add(yy+"/"+mm);
					
					
					model.addRow(vec);
					gunsu.setText("건수 :"+model.getRowCount());	
					}
				}rs.close(); pstmt.close();
			}catch(Exception ex){
				ex.printStackTrace();
			}			
		} 		
		
	}

	public void setD(HashMap<String, TempData> map) {
		this.map = map;
	}

	private JTable getTable() { // ////////////////테이블1
		if (table == null) {
			model = new DefaultTableModel(colName, 0) {			// 셀 내용 수정 불가
				public boolean isCellEditable(int rowIndex, int mColIndex) {
					return false;
				}
			};
			table = new JTable(model);
			dan();//단축키		
			table.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseClicked(MouseEvent e) {
					mouseC(table);				
				}
			});		
			mc.tableCellCenter(table);
			mc.tableCellRight(table);		
			
			
		}
		return table;
	}

	private JButton getBtnNewButton() {
		if (btnNewButton == null) {
			btnNewButton = new JButton("저장[F5]");
			btnNewButton.setFont(new Font("굴림", Font.PLAIN, 11));
			btnNewButton.addActionListener(new ActionListener() { // ///////////////////////
				public void actionPerformed(ActionEvent e) {	
					mc.ExcelSave(table) ;
				}
			});
			btnNewButton.setIcon(new ImageIcon(
					"C:\\Users\\jhta\\Desktop\\1403\\svn_pro\\src\\save.PNG")); 
		}
		return btnNewButton;
	}

	private JPanel getPanel() {
		if (panel == null) {
			panel = new JPanel();
			panel.setLayout(new BorderLayout(0, 0));
			panel.add(getPanel_4(), BorderLayout.CENTER);
		}
		return panel;
	}

	private JPanel getPanel_1() {
		if (panel_1 == null) {
			panel_1 = new JPanel();
			panel_1.setLayout(new BorderLayout(0, 0));
			panel_1.add(getPanel_5(), BorderLayout.CENTER);
		}
		return panel_1;
	}

	private JTabbedPane getTabbedPane() {
		if (tabbedPane == null) {
			tabbedPane = new JTabbedPane(JTabbedPane.TOP);
			tabbedPane.addKeyListener(new KeyAdapter() {
				@Override
				public void keyPressed(KeyEvent e) {	
					if(e.getKeyCode()==KeyEvent.VK_F5){					
						mc.ExcelSave(table);
					}
					else if(e.getKeyCode()==KeyEvent.VK_F11){
						try{
							switch(tabbedPane.getSelectedIndex()){
							case 0:	{table.print();	break;	}						
							}
						}catch(Exception ex){
							ex.printStackTrace();
						}		
					}
					else if(e.getKeyCode()==KeyEvent.VK_F2){	
						SendEmail frame = new SendEmail();
						frame.setVisible(true);
						frame.username.setText(person_name);
					}
				}
			});
			tabbedPane.setFont(new Font("굴림", Font.PLAIN, 11));
			tabbedPane.addTab("급여명세형식", null, getScrollPane(), null);
			tabbedPane.addTab("차트", null, getPanel_2(), null);
		}
		return tabbedPane;
	}

	private JPanel getPanel_4() {
		if (panel_4 == null) {
			panel_4 = new JPanel();
			panel_4.setBackground(new Color(0, 0, 102));
			FlowLayout flowLayout = (FlowLayout) panel_4.getLayout();
			panel_4.add(getIrum());
			panel_4.add(getNumber());
			panel_4.add(getNal());
			panel_4.add(getDate());
			panel_4.add(getPaymentD());
			panel_4.add(getComboBox1());
			panel_4.add(getComboBox());
			panel_4.add(getSearch());
			panel_4.add(getGunsu());
		}
		return panel_4;
	}

	private JLabel getIrum() {
		if (irum == null) {
			irum = new JLabel("이름");
			irum.setForeground(new Color(255, 255, 255));
			irum.setFont(new Font("굴림", Font.PLAIN, 11));
		}
		return irum;
	}

	private JLabel getNumber() {
		if (number == null) {
			number = new JLabel("사번");
			number.setForeground(new Color(255, 255, 255));
			number.setFont(new Font("굴림", Font.PLAIN, 11));
		}
		return number;
	}

	private JLabel getDate() {
		if (date == null) {
			date = new JLabel("년차");
			date.setOpaque(true);
			date.setFont(new Font("굴림", Font.PLAIN, 11));
			date.setAlignmentX(Component.RIGHT_ALIGNMENT);
			date.setForeground(SystemColor.desktop);
			date.setBackground(SystemColor.menu);
		}
		return date;
	}

	private JComboBox getComboBox() {
		if (comboBox == null) {
			comboBox = new JComboBox();
			comboBox.addKeyListener(new KeyAdapter() {
				@Override
				public void keyPressed(KeyEvent e) {
					if(e.getKeyCode()==KeyEvent.VK_F5){					
						mc.ExcelSave(table);
					}
					else if(e.getKeyCode()==KeyEvent.VK_F11){
						try{
							switch(tabbedPane.getSelectedIndex()){
							case 0:	{table.print();	break;	}						
							}
						}catch(Exception ex){
							ex.printStackTrace();
						}		
					}
					else if(e.getKeyCode()==KeyEvent.VK_F2){	
						SendEmail frame = new SendEmail();
						frame.setVisible(true);
						frame.username.setText(person_name);
					}
				}
			});
			comboBox.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					Search();
					
				}
			});
			comboBox.setFont(new Font("굴림", Font.PLAIN, 11));			
			for(int i=0;i<su1.length;i++){
				comboBox.addItem(su1[i]+"월");
			}
			comboBox.setSelectedIndex(12);

		}
		return comboBox;
	}

	private JComboBox getComboBox1() {
		if (comboBox1 == null) {
			comboBox1 = new JComboBox();
			comboBox1.setFont(new Font("굴림", Font.PLAIN, 11));
			for(int i=0;i<su.length-1;i++){
				comboBox1.addItem(su[i]+"년");
			}
			comboBox1.setSelectedIndex(0);
		}
		return comboBox1;
	}

	private JButton getSearch() {
		if (search == null) {
			search = new JButton("검색");
			search.addKeyListener(new KeyAdapter() {
				@Override
				public void keyPressed(KeyEvent e) {
					if(e.getKeyCode()==KeyEvent.VK_F5){					
						mc.ExcelSave(table);
					}
					else if(e.getKeyCode()==KeyEvent.VK_F11){
						try{
							switch(tabbedPane.getSelectedIndex()){
							case 0:	{table.print();	break;	}						
							}
						}catch(Exception ex){
							ex.printStackTrace();
						}		
					}
					else if(e.getKeyCode()==KeyEvent.VK_F2){	
						SendEmail frame = new SendEmail();
						frame.setVisible(true);
						frame.username.setText(person_name);
					}
				}
			});
			search.setFont(new Font("굴림", Font.PLAIN, 11));
			search.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					Search();					
				}
			});
		}
		return search;
	}

	private JLabel getPaymentD() {
		if (paymentD == null) {
			paymentD = new JLabel("지급일자");
			paymentD.setFont(new Font("굴림", Font.PLAIN, 11));
			paymentD.setForeground(new Color(255, 255, 255));
			paymentD.setOpaque(true);
			paymentD.setBackground(new Color(60, 60, 124));
		}
		return paymentD;
	}

	private JLabel getNal() {
		if (nal == null) {
			nal = new JLabel();
			nal.setForeground(new Color(255, 255, 255));
			nal.setText("입사");
			nal.setFont(new Font("굴림", Font.PLAIN, 11));
		}
		return nal;
	}

	private JButton getBtnNewButton_1() {
		if (btnNewButton_1 == null) {
			btnNewButton_1 = new JButton("출력[F11]");
			btnNewButton_1.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {
					try{
						switch(tabbedPane.getSelectedIndex()){
						case 0:	{table.print();	break;	}						
						}
					}catch(Exception ex){
						ex.printStackTrace();
					}					
				}
			});
			btnNewButton_1.setFont(new Font("굴림", Font.PLAIN, 11));
			btnNewButton_1.setIcon(new ImageIcon(
					"C:\\Users\\jhta\\Desktop\\1403\\svn_pro\\src\\print.PNG"));
		}
		return btnNewButton_1;
	}

	private JPanel getPanel_5() {
		if (panel_5 == null) {
			panel_5 = new JPanel();
			panel_5.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
			panel_5.add(getBtnNewButton());
			panel_5.add(getBtnNewButton_1());
			panel_5.add(getBtnNewButton_2());
		}
		return panel_5;
	}

	private JScrollPane getScrollPane() {
		if (scrollPane == null) {
			scrollPane = new JScrollPane();
			scrollPane.setViewportView(getTable());
		}
		return scrollPane;
	}

	public void setPersonalNumber(String number) {
		this.person_num = number;
	}
	public void setPersonalName(String name){
		this.person_name = name;
	}

	public void setStartDate(String nal){
		this.startDate = nal;
	}
	private JButton getBtnNewButton_2() {
		if (btnNewButton_2 == null) {
			btnNewButton_2 = new JButton("메일 [F2]");
			btnNewButton_2.setFont(new Font("굴림", Font.PLAIN, 11));
			btnNewButton_2.setIcon(new ImageIcon(
					"C:\\Users\\jhta\\Desktop\\1403\\svn_pro\\src\\mail.PNG"));
			btnNewButton_2.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					SendEmail frame = new SendEmail();
					frame.setVisible(true);
					frame.username.setText(person_name);
				}
			});
		}
		return btnNewButton_2;
	}
	private JPanel getPanel_2() {
		if (panel_2 == null) {
			panel_2 = new JPanel();
			panel_2.setLayout(new BorderLayout(0, 0));
			panel_2.add(getPanel_3(), BorderLayout.NORTH);
			panel_2.add(getPanel_6(), BorderLayout.CENTER);
			
//			<추가>
			SimpleDateFormat sd  = new SimpleDateFormat("YY");
			SimpleDateFormat sd2 = new SimpleDateFormat("MM");
			String YY =sd.format(new Date());
			int MM = Integer.parseInt(sd2.format(new Date()));
			if(MM>=10) MM=4; else if (MM>=7)MM=3; else if(MM>=4)MM=2; else MM=1;
			chartopen(YY,MM+"", person_num);
		}
		return panel_2;
	}

																//	%%%%%%%%%%%%%%%%%%%%%%%5
	public void chartopen(String y,String q,String person){
		if(q.equals("전체")) q="5";
		p = new PolylineBarChart(conn, y, q, person);
		panel_6.removeAll();
		panel_6.updateUI();
		JFreeChart chart = p.getChart2(); // JFreeChart
		ChartPanel panel = new ChartPanel(chart);
		panel.setLayout(new BorderLayout(0,0));
		panel.setBounds(0, 0, 400, 300);
		panel.setVisible(true);
		panel_6.add(panel, BorderLayout.CENTER);
	}
		public void tochart(){							//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&7
		
		int Y = comboBox_11.getSelectedIndex(); //년     12개 0~11
		int Q = comboBox_12.getSelectedIndex();	//분기   
		String yy=su[Y];
		String qq=su2[Q];
		chartopen(yy,qq,person_num);		
	}
		
	public void dan(){	//단축키
		table.addKeyListener(new KeyAdapter() {		
			@Override
			public void keyPressed(KeyEvent arg0) {				
				if(arg0.getKeyCode()==KeyEvent.VK_F5){	
					mc.ExcelSave(table);
				}
				else if(arg0.getKeyCode()==KeyEvent.VK_F11){
					try{
						switch(tabbedPane.getSelectedIndex()){
						case 0:	{table.print();	break;	}						
						}
					}catch(Exception ex){
						ex.printStackTrace();
					}		
				}
				else if(arg0.getKeyCode()==KeyEvent.VK_F2){	
					SendEmail frame = new SendEmail();
					frame.setVisible(true);
					frame.username.setText(person_name);
				}
				}
		})    ;		
	}
	private JPanel getPanel_3() {
		if (panel_3 == null) {
			panel_3 = new JPanel();
			panel_3.add(getComboBox_11());
			panel_3.add(getComboBox_12());
			panel_3.add(getBtnNewButton_3());
		}
		return panel_3;
	}
	private JPanel getPanel_6() {
		if (panel_6 == null) {
			panel_6 = new JPanel();
		}
		return panel_6;
	}
	private JComboBox getComboBox_11() {
		if (comboBox_11 == null) {
			comboBox_11 = new JComboBox();
			comboBox_11.setFont(new Font("굴림", Font.PLAIN, 11));
			for(int i=0;i<su.length-1;i++){
				comboBox_11.addItem(su[i]+"년");
			}
			comboBox_11.setSelectedIndex(0);
		}
		return comboBox_11;
	}
	private JComboBox getComboBox_12() {
		if (comboBox_12 == null) {
			comboBox_12 = new JComboBox();
			comboBox_12.setFont(new Font("굴림", Font.PLAIN, 11));
			for(int i=0;i<su2.length;i++){
				comboBox_12.addItem(su2[i]+"분기");
				}			
			comboBox_12.setSelectedIndex(4);
		}
		return comboBox_12;
	}	
	
	private JButton getBtnNewButton_3() {
		if (btnNewButton_3 == null) {
			btnNewButton_3 = new JButton("조회");
			btnNewButton_3.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					tochart();
				}
			});
		}
		return btnNewButton_3;
	}
	private JLabel getGunsu() {
		if (gunsu == null) {
			gunsu = new JLabel("");
			gunsu.setForeground(Color.WHITE);
		}
		return gunsu;
	}
}
